<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        //编写一个javascript对象
        var user = {
            name: "秦疆",
            age: 3,
            sex: "男"
        };
        console.log(user);
        //将js对象转换为json对象
        var json = JSON.stringify(user);
        console.log(json);
        //将json对象转换为js对象
        var js=JSON.parse(json);
        console.log(js);
    </script>
</head>
<body>

</body>
</html>